package com.zztl.infiniteBand.presenter

import android.content.Context

import com.zztl.infiniteBand.base.BasePresenter
import com.zztl.infiniteBand.model.TradingDetailBean
import com.zztl.infiniteBand.net.FilterSubscriber
import com.zztl.infiniteBand.net.RetorfitServiceManger
import com.zztl.infiniteBand.net.converter.DataConverter
import com.zztl.infiniteBand.net.requestBean.GetTranscationDetailRequest
import com.zztl.infiniteBand.ui.view.mvpview.TranscationDetailView


/**
 * @desc
 * @auth ${user}
 * @time 2018/6/13  21:32
 */
class TranscationPresenter : BasePresenter<TranscationDetailView>() {
    fun getData(getTranscationDetailRequest: GetTranscationDetailRequest, context: Context) {
        addSubscribe(RetorfitServiceManger
                .observe(RetorfitServiceManger.instance!!.apiService
                        .getTransactionRecordDetail(DataConverter.instance.toJson(getTranscationDetailRequest)))
                .subscribe(object : FilterSubscriber<TradingDetailBean>(context) {
                    override fun success(bean: TradingDetailBean) {
                        view!!.getSuccess(bean)
                    }


                }))
    }
}
